/*jslint browser: true, devel: true, bitwise: true, white: true, plusplus: true, forin:true, nomen:true */
/*global $:true, define:true */

/**
 * @module Test
 */

define(['WID/Core/Future','WID/Core/AbstractMethodException','WID/Utility/HTMLHelper'],
function(Future,AbstractMethodException,HTMLHelper) {
"use strict";

function Matcher() {}

Matcher.toPrimitive = function(value) {
	if (value === undefined) {
		return 'undefined';
	}
	
	if (value === null) {
		return 'null';
	}
	
	if (typeof value === 'string') {
		return '"'+HTMLHelper.htmlEntities(value)+'"';
	}
	
	if (typeof value === 'object') {
		return value.toSource();
	}
	
	return value;
};

Matcher.prototype = {
	constructor: Matcher,
	
	getName: function() {
		throw new AbstractMethodException(Matcher,'getName');
	},
	
	match: function(target, negation, exp) {
		throw new AbstractMethodException(Matcher,'match');
	},
	
	getInfo: function(target, negation, exp) {
		return Matcher.toPrimitive(target)+( (negation)?' not ':' ');
	}
	
	
};
	
return Matcher;
});
